I noticed an Xcode Extension I wrote a couple of years ago isn't showing up in the Editor menu of Xcode. So I opened up the project, ran the Extension and the grayed out version of Xcode shows up but my extension no longer appears in the "Editor" menu.
So I just tried to create a brand new Xcode project, with an Xcode extension. Right out of the box, no code changes from the template, and I can't get the new project's Xcode extension to appear in the "Editor menu".
In System Preferences the app is checked off under "Xcode Extensions" but still nowhere to be found?
Post
Replies
Boosts
Views
Activity
When I open a new window via UIWindowSceneActivationAction, the window is shown like a modally presented view controller. I noticed a little layout hiccup when the window is in this state, because the window is reporting a safeAreaInset.bottom value of 20.0 even though the window is nowhere near the Home Indicator.
Is there a good way to detect when a window is in this "modal like presentation" state on iPad? Size classes don't provide. I'd hate to have to sniff the frame of the window and compare it to the mainScreen frame (I know UIScreen.mainScreen is deprecated)?
Since iOS 15.7 these crash reports have started appearing:
0 CoreFoundation 0x18043bd1c __exceptionPreprocess + 216 (NSException.m:200)
1 libobjc.A.dylib 0x197c60ee4 objc_exception_throw + 56 (objc-exception.mm:565)
2 CoreFoundation 0x18050c75c -[NSObject(NSObject) doesNotRecognizeSelector:] + 140 (NSObject.m:147)
3 UIKitCore 0x18359320c -[UIResponder doesNotRecognizeSelector:] + 268 (UIResponder.m:685)
4 CoreFoundation 0x1803d561c forwarding + 1472 (NSForwarding.m:3577)
5 CoreFoundation 0x1803d482c _CF_forwarding_prep_0 + 92
6 CoreFoundation 0x1803d22e8 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 20 (CFNotificationCenter.c:652)
7 CoreFoundation 0x1804678e4 ___CFXRegistrationPost_block_invoke + 48 (CFNotificationCenter.c:173)
8 CoreFoundation 0x18043cc04 _CFXRegistrationPost + 416 (CFNotificationCenter.c:199)
9 CoreFoundation 0x1803e7070 _CFXNotificationPost + 708 (CFNotificationCenter.c:1147)
10 Foundation 0x181ad704c -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 (NSNotification.m:560)
11 UIKitCore 0x182a9ac08 -[UIScene _invalidate] + 664 (UIScene.m:942)
12 UIKitCore 0x182c2765c -[UIWindowScene _invalidate] + 160 (UIWindowScene.m:334)
13 UIKitCore 0x182991f34 -[UIApplication workspace:willDestroyScene:withTransitionContext:completion:] + 216 (UIApplication.m:3999)
14 UIKitCore 0x1829291a0 -[UIApplicationSceneClientAgent scene:willInvalidateWithEvent:completion:] + 360 (UIApplicationSceneClientAgent.m:61)
15 FrontBoardServices 0x1915b79d8 -[FBSScene _callOutQueue_agent_willDestroyWithTransitionContext:completion:] + 256 (FBSScene.m:456)
16 FrontBoardServices 0x1915bf810 __84-[FBSWorkspaceScenesClient _queue_invalidateScene:withTransitionContext:completion:]_block_invoke_2 + 100 (FBSWorkspaceScenesClient.m:622)
17 FrontBoardServices 0x1915a3bdc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 232 (FBSWorkspace.m:352)
18 FrontBoardServices 0x1915b5470 __84-[FBSWorkspaceScenesClient _queue_invalidateScene:withTransitionContext:completion:]_block_invoke + 280 (FBSWorkspaceScenesClient.m:621)
19 libdispatch.dylib 0x1800fc094 _dispatch_client_callout + 16 (object.m:560)
20 libdispatch.dylib 0x18009f150 _dispatch_block_invoke_direct$VARIANT$mp + 220 (queue.c:501)
21 FrontBoardServices 0x1915a52ac FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 40 (FBSSerialQueue.m:157)
22 FrontBoardServices 0x1915a47c0 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 176 (FBSSerialQueue.m:181)
23 FrontBoardServices 0x1915a8960 -[FBSSerialQueue _performNextFromRunLoopSource] + 24 (FBSSerialQueue.m:194)
24 CoreFoundation 0x18045c4fc CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24 (CFRunLoop.c:1972)
Looks like all system code. Anyone else running into these since iOS 15.7?
I’m trying to migrate a custom UITableViewCell to use a content configuration so I can properly subclass the content view (setting a subclass on the content view in Interface Builder apparently is not supported).
So when I load up the cell and set the content configuration my console is flooded with these logs:
Warning: You are setting a new content configuration to a cell that has an existing content configuration, but the existing content view does not support the new configuration. This means the existing content view must be replaced with a new content view created from the new configuration, instead of updating the existing content view directly, which is expensive. Use separate reuse identifiers for different types of cells to avoid this. Make a symbolic breakpoint at UIContentConfigurationAlertForReplacedContentView to catch this in the debugger.
Cell: <MyCellSubclassHere: 0x15d0b5c00>
Existing content configuration: (null);
New content configuration: <MyCustomConfigurationHere: 0x6000034ad190>
As you can see the existing content configuration is nil. I tried setting my custom content configuration as early as possible (by overriding the designated initializer on UITableViewCell) as a workaround but that didn't work. Still console spew.
And by the time cellForRowAtindexPath: is called the content configuration is always nil and has to be rebuilt (apparently UIKit is setting it to nil in prepareForReuse?)
I also tried overriding -setContentConfiguration: to catch when the configuration is being set to nil but UIKit must be setting the ivar to nil directly, because the setter is never called with nil.
Anyone know of a workaround? I don't want to ship an app that constantly logs this out on scroll.
I opened FB11595949
I noticed a bug on rotation change in my app on iPhone 14 Pro Max simulator. Basically a view in my view hierarchy is hidden when it shouldn't be. In landscape mode there isn't enough room for this view so I hide it on the iPhone (not essential). But when tilting back to portrait mode I unhide it.
-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
BOOL isIPhone = UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPhone;
BOOL isIPhoneAndGoingLandscapeMode = (isIPhone
&& size.width > size.height);
if (isIPhoneAndGoingLandscapeMode)
{
self.someView.hidden = YES;
}
else
{
self.someView.hidden = NO;
}
}
So this view controller is presented modally (form sheet style).
On iPhone 14 Pro Max on orientation -viewWillTransitionToSize:withTransitionCoordinator: is called twice and the size parameter is always:
(CGSize) size = (width = 414, height = 394)
This is the sized passed to my app when rotating to portrait and landscape so my isIPhoneAndGoingLandscapeMode flag always is YES because 414 > 394. The 414 x 394 size appears to be false.
My view controller's view in landscape on iPhone 14 pro max logs out to:
(origin = (x = 0, y = 0), size = (width = 932, height = 430))
And 932 x 430 is the size I expected to be passed to me in -viewWillTransitionToSize:withTransitionCoordinator:
Unless I'm missing something can this behavior be explained?
Testing on the iPhone 14 Pro simulator I notice if the device is in the landscape orientation, snapshot images my app takes are clipped (the x origin is off).
I take a snapshot of a view like this:
-(UIImage*)getSnapshotForView:(UIView*)snapShotView
{
UIGraphicsBeginImageContextWithOptions(snapShotView.bounds.size, NO, 0.0f);
[snapShotView drawViewHierarchyInRect:snapShotView.bounds afterScreenUpdates:YES];
UIImage *snapShotImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return snapShotImage;
}
So I have an iPhone SE 3rd gen and all is working fine. But I figured I'd test in the iPhone 14 Pro simulator.
When the simulator is in landscape mode the generated image is inset like 100 points on the x origin and the content is clipped off on the right side.
So I looked at the view I was snapshotting and I thought I wasn't accounting for safe area insets properly (right and left) but I was. The subviews of the view I'm snapshotting all have the expected CGRect value for their frames.
Looks like iPhone 14 Pro is rendering snapshots location on the x axis when the device is in landscape mode (at least that appears to be the case in the simulator at least).
Any ideas if I'm doing something wrong?
Testing my app, I noticed a button in my UI which presents a UIAlertController appeared to do nothing all of a sudden, after a few days.
So hooking up the console app I see UIKit spit out the following log when I press the button:
"Warning: Attempt to present UIAlertController on MyViewController which is already presenting SomeOtherViewController.
No view controller appears to be presented. SomeOtherViewController is not currently in the UI but for some reason after it was dismissed the presentedViewController property wasn't set to nil (haven't been able to reproduce the issue yet).
So SomeOtherViewController I know is a "Detail View Controller" which only get pushed on the UINavigationController stack (I never present it modally). The only time it gets presented modally is when it is a "preview view controller" used in UIContextMenuConfiguration, but otherwise it doesn't get presented. Has anyone run into this sort of situation before and know of a potential cause/solution?
The presentedViewController does not appear on screen but for some reason UIKit is holding a strong reference to it in the presentedViewController property which prevents subsequent calls to -presentViewController:animated:completion:
As a workaround I could try using the code below but I'd really like to find the root cause of the issue:
-(void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion
{
UIViewController *currentPresentedVC = self.presentedViewController;
if ([currentPresentedVC isKindOfClass:[SomeOtherViewController class]])
{
//this is unexpected.
[currentPresentedVC dismissViewControllerAnimated:NO completion:^{
[super presentViewController:viewControllerToPresent animated:flag completion:completion];
}];
}
else
{
[super presentViewController:viewControllerToPresent animated:flag completion:completion];
}
}
I'd like to resize a UITargetedPreview as part of a custom animation.
I tried doing this by using the animator provided in:
- (void)tableView:(UITableView *)tableView willDisplayContextMenuWithConfiguration:(UIContextMenuConfiguration *)configuration animator:(nullable id<UIContextMenuInteractionCommitAnimating>)animator
But resizing the source view for the target preview does not cause the container view to resize with it (leaving a large gap after my custom animation completes). So my preview is wrapped in a visual effects view that doesn't downsize with UITargetedPreview's view I provided.
I also tried wrapping a snapshot view in a UIViewController and using previewProvider block instead of using a UITargetPreview.
I am able to resize the previewViewController by setting the preferredContentSize property and resizing works, but it still doesn't look right because the default animation for the preview view controller breaks with the custom animation I'm trying to implement.
Anyone know if this is possible?
After upgrading to Xcode 14 I cannot submit an update to one of my apps that uses the GoogleMobileAdsSDK. I'm getting the following error when I try to submit to the App Store:
Missing or invalid signature. The bundle 'com.firebase.Firebase-nanopb' at bundle path 'Payload/PATH_HERE/nanopb.framework' is not signed using an Apple submission certificate.
Anyone else getting this and know of a solution?
I'm trying to figure out how I'm suppose to work with this API on UIFindSession:
- (void)performSearchWithQuery:(NSString *)query options:(nullable UITextSearchOptions *)options;
I want to provide a UITextSearchOptions object, but the properties are readonly so I'm not sure what purpose it serves exposing it in the public API?
@interface UITextSearchOptions : NSObject
/// See UITextSearchMatchMethod above.
@property (nonatomic, readonly) UITextSearchMatchMethod wordMatchMethod;
/// Comparison options to use when searching for strings.
@property (nonatomic, readonly) NSStringCompareOptions stringCompareOptions;
@end
So I can't simply invoke a search like this...which would've really been nice...
UIFindSession *session = findInterfaction.activeFindSession;
UITextSearchOptions *searchOptions = [[UITextSearchOptions alloc]init];
searchOptions.stringCompareOptions = NSCaseInsensitiveSearch; //readonly can't...
[session performSearchWithQuery:searchString options:searchOptions];
There is this API:
/// available in @c UITextSearchOptions, which can be either modified, augmented, or omitted.
@property (nonatomic, readwrite, copy, nullable) UIMenu *_Nullable (^optionsMenuProvider)(NSArray<UIMenuElement *> *defaultOptions);
So I can remove menu items that edit the UITextSearchOptions but how exactly do I "override" them for my needs?
I'm using UIDocumentPickerViewController to open a url. Works fine in debug mode but version on the App Store is failing.
Code to create the document picker is like:
NSArray *theTypes = [UTType typesWithTag:@"docxtensionhere" tagClass:UTTagClassFilenameExtension conformingToType:nil];
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc]initForOpeningContentTypes:theTypes];
documentPicker.delegate = self;
[self presentViewController:documentPicker animated:YES completion:nil];
So in debug mode this is all gravy. -documentPicker:didPickDocumentsAtURLs: passes back a URL and I can read the file.
In release mode I get a URL but my app is denied access to read the file. After inspecting some logging it appears the sandbox is not granting my app permission.
error Domain=NSCocoaErrorDomain Code=257 "The file “Filename.fileextensionhere” couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/private/var/mobile/Library/Mobile Documents/comappleCloudDocs/Filename.fileextensionhere, NSUnderlyingError=0x2834c9da0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
--
If I'm doing something wrong with UIDocumentPickerViewController it is a real shame that permission is not being denied in Debug mode, as devs are more likely to catch in prior to release. Anyone know where I'm going wrong and if not have a workaround? Thanks in advance.
I have an iOS app that was rejected and I submitted a revised binary. In my case auto-renewable subscriptions were returned with the initial rejections and I didn't realize I had to add them for review again with my revised submission....so I submitted a revised binary which got rejected because the subscriptions were returned on the initial rejection.
So I go to "Subscriptions" area for my app and the status is "Developer Action Needed." If I click a subscription the "Submit for Review" button is disabled. I tried making an edit to the Subscription to see if that would cause the button to become enabled but it does not. Can't figure out how I can resubmit these subscriptions for review....so my submission is stuck...
Perhaps when an app with attached iAP/Subscriptions is rejected they shouldn't detach iAP/subscriptions from the app? Developers can easily not notice and submit a new build and not realize that their iAP/subscriptions are no longer attached to the build...and if App Review doesn't notice you could have an app get on the Store which potentially shows UI for non-working iAP/subscriptions.
If anyone has ran into this and could help I'd appreciate it. Thanks a lot.
I know WKWebview is in another process from the main app. My question is is the UIBackgroundModes audio entry in Info.plist required on the main app for WKWebview to play audio/video/airplay in the background?
Or is simply setting WKWebViewConfiguration allowsAirPlayForMediaPlayback and allowsPictureInPictureMediaPlayback enough?
I recall having issues with background audio from WKWebView on older versions of iOS a couple years ago so I added the audio entry to the Info.plist....
but I just removed the key from the Info.plist and background audio from WKWebview seems to be working fine...maybe audio background mode is not required? Or does it only seem to be working because my app is attached to the debugger? Or is this a bug?
I now have an M1 Mac and an Intel Mac. I have an XCFramework that targets the iOS simulator and devices. My XCFramework works fine but I'd like to be able to run my app (which uses the XCFramework) on the iOS simulator on both my Macs (m1 & intel).
Now my M1 Mac complains about the x86_64 architecture when I try to run it on the simulator. So I rebuilt the XCFramework (recompiling the simulator version on the M1 Mac).
I'm compiling the source code from Terminal (building OpenSSL). There is no .xcarchive here. Anyway now the app runs on the simulator on the M1 Mac but on the Intel Mac it won't build (basically the same problem in reverse).
So... I made three versions of the library now (for iOS devices, iOS simulator on m1 Mac, and for the iOS simulator on Intel Macs). When I try to make an XCFramework to wrap all three static libraries I get the following error:
Both "ios-x86_64-simulator" and "ios-arm64-simulator" represent two equivalent library definitions.
I found another thread where the accepted answer was to lipo the x86_64 and arm simulators together, then build the xcframework. I've seen posts from Apple engineers that say using lipo is not supported (reference: https://developer.apple.com/forums/thread/709812?answerId=719667022#719667022 )
So where am I going wrong? I try to make the xcframework like so:
xcodebuild -create-xcframework
-library build/sim/openssl-1.1.1q/libcrypto.a -headers build/sim/openssl-1.1.1q/crypto
-library build/phones/openssl-1.1.1q/libcrypto.a -headers build/phones/openssl-1.1.1q/crypto
-library build/intelsim/openssl-1.1.1q/libcrypto.a -headers build/intelsim/openssl-1.1.1q/crypto
-output build/Crypto.xcframework
I'm getting some Crash Reports for an app of mine that's on the Mac App Store. A few details:
-All the crash reports are on ARM-64 Macs.
-The call stack shows my app calling NSURL's -getResourceValue:forKey: method with NSURLLocalizedNameKey, which is the last call made by my app before the crash. After that crash logs look like this:
**Thread 0 Crashed:
0 libobjc.A.dylib 0x00000001a623c4b0 objc_retain + 16
1 LaunchServices 0x00000001a6954f68 -[FSNode(PathAndName) nameWithError:] + 72
2 LaunchServices 0x00000001a6a36278 +[_LSDisplayNameConstructor(ConstructForAnyFile) displayNameConstructorWithContextIfNeeded:bundle:bundleClass:node:preferredLocalizations:error:] + 2732
3 LaunchServices 0x00000001a6a357ac +[_LSDisplayNameConstructor(ConstructForAnyFile) displayNameConstructorWithContextIfNeeded:node:error:] + 44
4 LaunchServices 0x00000001a6ae5b20 LaunchServices::URLPropertyProvider::getDisplayNameConstructor(LaunchServices::Database::Context&, FSNode*, LaunchServices::URLPropertyProvider::State*, NSError* __autoreleasing*) + 88
5 LaunchServices 0x00000001a6ae1930 LaunchServices::URLPropertyProvider::prepareLocalizedNameValue(LaunchServices::Database::Context&, FSNode*, __FileCache*, __CFString const*, LaunchServices::URLPropertyProvider::State*, NSError* __autoreleasing*) + 328
6 LaunchServices 0x00000001a6953d6c LaunchServices::URLPropertyProvider::prepareValues(__CFURL const*, __FileCache*, __CFString const* const*, void const**, long, void const*, __CFError**) + 456
7 CoreServicesInternal 0x00000001a8def6f0 prepareValuesForBitmap(__CFURL const*, __FileCache*, _FilePropertyBitmap*, __CFError**) + 452
8 CoreServicesInternal 0x00000001a8dec5ec _FSURLCopyResourcePropertyForKeyInternal(__CFURL const*, __CFString const*, void*, void*, __CFError**, unsigned char) + 236
9 CoreFoundation 0x00000001a64546b0 CFURLCopyResourcePropertyForKey + 144
10 CoreFoundation 0x00000001a646b944 -[NSURL getResourceValue:forKey:error:] + 120**
--
I haven't been able to reproduce the issue on my ARM-64 Mac. Not sure what's going with _LSDisplayNameConstructor or if there is a way I can workaround/resolve.
Some of the crashes have the following lines included:
Kernel Triage:
VM - Compressor failed a blocking pager_get
VM - Compressor failed a blocking pager_get
VM - Compressor failed a blocking pager_get
VM - Compressor failed a blocking pager_get
VM - Compressor failed a blocking pager_get